home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-15 | 6.0 KB | 193 lines | [TEXT/MPS ] |
- //
- // "myResMerge.r"
- //
- // This Installer script source demonstrates use of ResMerge atoms.
- // ResMerge atoms copy all the resources from the source file to
- // the target file without the need for specifying any of the
- // individual resource items. This atom type's main value is as
- // a time saving device when writing installer scripts.
- //
- // IMPORTANT SAFETY TIP : Both Custom Install options in this example
- // install several 'vers' resource items to the target file. These
- // "extra" version resources are basically harmless, but the first
- // option will install those resources to your active system file.
- // This is a weird ( but harmless ) thing to do and is intended only
- // as an example of how to add resource items to the active System file
- // using ResMerge atoms.
- //
- // Three important things to remember about ResMerge atoms:
- // 1) They are always executed before resource atoms ( 'inra' )
- // when the items they reference are contained on the same
- // install disk.
- // 2) ResMerge atoms are not supported with InstaCompOne compression
- // at this time ( 4.0.3 ).
- // 3) ResMerge atoms always overwrite the resource items in the
- // target file.
- //
- // NOTE: This example uses pre-4.0 method for creating Custom Install
- // options. It is not intended as an example of how to use 4.0 User
- // Interface features. For more information on how to create the
- // Easy and Custom Install options, etc. try the "Custom UI" example.
- //
- //
- // mark young • 07/20/94
- //
- // Copyright 1993-1994, Apple Computer, Inc., All Rights Reserved
- //
-
- #include "InstallerTypes.r"
-
-
- // • packages
-
- resource 'inpk' (100) {
- format0 {
- showsOnCustom,
- removable,
- forceRestart, // always force restart when modifying system files
- 0,
- 0,
- "ResMerge atom to active System file on target volume.",
- {
- 'inrm', 1000;
- },
- }
- };
-
- resource 'inpk' (200) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart, // no need to reboot in this case
- 0,
- 0,
- "ResMerge atom to TeachText on root of target volume.",
- {
- 'inrm', 2000;
- },
- }
- };
-
-
- // • ResMerge atoms
-
- // NOTE: For sake of simplicity both of the resource merge atoms
- // defined below use the same source file to store the resource
- // items to be installed. A more common usage of the resMerge atom
- // ( 'inrm' ) is to have unique source files ( containing different
- // resource items ) for each resMerge atom. To do this, just define
- // a unique source spec ( 'infs' ) for each resMerge atom and specify
- // the ID for the source spec for each resMerge atom.
-
- // ResMerge atom for source >> active System file
- resource 'inrm' (1000) {
- format0 {
- 0,
- 10001, // target spec for active System file
- 10000, // shared source spec for ResMerge atom
- ""
- }
- };
-
- // ResMerge atom for source >> TeachText on root folder of target volume
- resource 'inrm' (2000) {
- format0 {
- 0,
- 20001, // target spec for TeachText on root folder of target volume
- 10000, // shared source spec for ResMerge atom
- ""
- }
- };
-
-
- // • file specs
-
- // target file spec for active System file on target volume
- resource 'intf' (10001) {
- format1 {
- noSearchForFile, // use default search path
-
- TypeCrMustMatch, // If this is set to TypeCrMustMatch
- // then a file with a different type
- // and creator than those specified
- // below will not be updated.
- // If this is set to TypeCrNeedNotMatch
- // then type and creator of an existing
- // target file are ignored.
-
- // The Type and Creator fields will be used to set the
- // file's Type and Creator when a new file is created.
- // NOTE: It's never a good idea to create a bogus
- // System file with just a couple of resources. A better
- // way to handle installation to a System file is to use
- // a resource atom ('inra'), because it allows you to
- // require the target file to exist before installing
- // any resource items to the target file.
- 'zsys', // TYPE for new file
- 'MACS', // CREATOR for new file
-
- 0, // finder attribute flags
- // filled by ScriptCheck is value is 0
-
- 1, // creation date for new file
- 1, // modification date for new file
- // NOTE: DATE values are filled
- // by ScriptCheck if the value is 1
-
- 0, // search proc ID ( 'insp' ), none used
-
- "special-macs:System" // path to target file
- }
- };
-
- // target file spec for TeachText application on root of target volume
- // NOTE: When a target spec is called from within a resource atom of
- // any kind ( 'inra', 'inrm', 'inr#' ), the type, creator, dates and
- // Finder attributes fields will only apply when creating a new file.
- resource 'intf' (20001) {
- format1 {
- noSearchForFile, // use default search path
-
- TypeCrMustMatch, // If this is set to TypeCrMustMatch
- // then a file with a different type
- // and creator than those specified
- // below will not be updated.
- // If this is set to TypeCrNeedNotMatch
- // then type and creator of an existing
- // target file are ignored.
-
- // The Type and Creator fields will be used to set the
- // file's Type and Creator when a new file is created.
- 'APPL', // TYPE for new file
- 'ttxt', // CREATOR for new file
-
- 0, // finder attribute flags
- // filled by ScriptCheck is value is 0
-
- 1, // creation date for new file
- 1, // modification date for new file
- // NOTE: DATE values are filled
- // by ScriptCheck if the value is 1
-
- 0, // search proc ID ( 'insp' ), none used
-
- ":TeachText" // path to target file
- }
- };
-
- // shared source file spec for ResMerge source file
- resource 'infs' (10000) {
- 'rsrc', // TYPE for source file
- 'RSED', // CREATOR for source file
-
- 0x1, // creation DATE for source file
-
- // - ScriptCheck will fill in date
- // fields that have a value of 0x1
-
- noSearchForFile, // IGNORED in Installer 4.0.x
- TypeCrMustMatch, // TYPE, CREATOR must match file on install disk
- "Disk 1:ResMergeSource.rsrc" // path to target file
- };
-
-